#include "stdio.h"
#include "kbdriver.h"



char getchar(int fd)
{

    char key = analysisKeycode(fd);
    
    return key;
}

int readLine(int fd,char* buf)
{   
    uint64_t key = 0;
    uint64_t count = 0;
    while(1)
    {
        key = analysisKeycode(fd);

        if(key == '\n')
        {
            break;
        }
        else if(key)
        {

            buf[count++] = key;
            printf("%c",key);
        }
        else{
            continue;
        }
    } 
    
    return count;
}
